package com.twobears.applicationrunner;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Order(1)
@Component
public class CustomApplicationRunner implements ApplicationRunner {
    private static final Logger LOGGER = LoggerFactory.getLogger(CustomApplicationRunner.class);
    @Override
    public void run(ApplicationArguments args) throws Exception {
        LOGGER.info("控制台接收的参数：{},{},{}" , args.getOptionNames(), args.getNonOptionArgs(), args.getSourceArgs());
    }
}
